﻿using System;
using Xunit;

namespace storge.Tests
{
	public class PhysicalFolderFactoryTests
	{
		[Fact]
		public void GetFolder_Initialises_Path()
		{
			const string path = "C:\\My\\Path\\To\\A\\Folder";

			IFolderFactory factory = new PhysicalFolderFactory();

			IFolder folder = factory.GetFolder(path);

			Assert.Equal(path, folder.Path);
		}

		[Fact]
		public void GetFolder_SpecialFolder_Initialises_Path()
		{
			Environment.SpecialFolder commonDocs = Environment.SpecialFolder.CommonDocuments;

			IFolderFactory factory = new PhysicalFolderFactory();

			IFolder folder = factory.GetFolder(commonDocs);

			Assert.NotNull(folder.Path);
			Assert.True(folder.Path.Length > 3);
		}

		[Fact]
		public void GetFile_Initialises_Path()
		{
			const string path = "C:\\My\\Path\\To\\A\\File.txt";

			IFolderFactory factory = new PhysicalFolderFactory();

			IFile file = factory.GetFile(path);

			Assert.Equal(path, file.Path);
		}
	}
}
